#include <IBean.h>
#include <ICamera.h>
#include "IDAServlet.h"
#include "IServlet.h"
#include "ILogger.h"
#include "IContainer.h"
class DAServletImp : public IDAServlet{
public:
 
    virtual void openCamera(ISession* session){
       // qcarcam_test_start();
       // Bean<ICamera>("qcarcam")->start();
       LogI("invoke Bean<ICamera>(\"qcarcam\")->start()");
    }


    virtual void stopCamera(ISession* session)
    {
        //qcarcam_test_stop();
        //Bean<ICamera>("qcarcam")->stop();
        LogI("invoke Bean<ICamera>(\"qcarcam\")->stop()");
    }
    virtual void onClose(ISession* session) {
        LogI("onClose %p",session);
        // Bean<ICamera>("qcarcam")->stop();
        LogI("invoke Bean<ICamera>(\"qcarcam\")->stop()");
        
    }
    virtual void onOpen(ISession* session) {
        LogI("onOpen %p",session);
        // Bean<ICamera>("qcarcam")->start();
        LogI("invoke Bean<ICamera>(\"qcarcam\")->start()");
        
    }
    virtual void onLoad(INode *node) {
        LogI("servlet onLoad");
    }
    virtual void onUnload() {
        LogI("servlet onUnload");
    }
};

class DAServletImp4Test : public IDAServlet4Test{
public:
    virtual void openCamera4Test(ISession* session,const int& x, const int& y){
       // qcarcam_test_start();
       // Bean<ICamera>("qcarcam")->start();
       LogI("invoke openCamera4Test x:%d y:%d",x,y);
    }
};

REG_PLUGIN(DAServletImp);
REG_PLUGIN(DAServletImp4Test);
